package com.gistmap.service.impl;

import com.gistmap.bean.Comment;
import com.gistmap.dao.CommentDao;
import com.gistmap.dao.UserDao;
import com.gistmap.dto.CommentDto;
import com.gistmap.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/4/14.
 */
@Service
public class CommentServiceImpl implements CommentService{
    @Autowired
    private CommentDao commentDao;
    @Autowired
    private UserDao userDao;

    public void save(Comment comment,Integer becid,Map map) {
        System.out.println(comment);
        commentDao.save(comment);
        userDao.addMessage(becid);
        userDao.saveAction(map);
    }

    public List<CommentDto> getReplyList(String aid) {
        return commentDao.getReplyList(aid);
    }


}
